package com.lagou.service.impl;

import com.lagou.entity.Stock;
import com.lagou.repository.StockRepository;
import com.lagou.service.StockService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 13771
 * @date 2021/1/15 16:29
 * @description
 */
@Service
public class StockServiceImpl implements StockService {
    @Resource
    private StockRepository stockRepository;

    @Override
    public boolean saveOrUpdate(Stock stock) {
        stockRepository.save(stock);
        return true;
    }

    @Override
    public Stock findById(Integer id) {
        return stockRepository.findById(id).get();
    }
}
